<%@page pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="v" tagdir="/WEB-INF/tags"%>
<v:layout>
	<h1>增加学生</h1>
	<c:url value="/student/add.do" var="formUrl" />
	<form:form id="form" action="${formUrl }" method="post" modelAttribute="addForm" cssClass="form-horizontal">
		<div class="form-group">
			<label class="col-sm-2 control-label" for="name">学生姓名</label>
			<div class="col-sm-10">
				<form:input path="name" cssClass="form-control" 
				data-rule-required="true" 
				data-msg-required="请输入学生姓名"
				data-rule-rangelength="[5,20]"
				data-msg-rangelength="姓名长度必须在{0}~{1}之间"
				 />
				<form:errors path="name" element="label" cssClass="text-danger"></form:errors>
			</div>
		</div>
		<div class="form-group" style="text-align: center;">
			<button class="btn btn-primary">提交</button>
			<a class="btn btn-default" href="<c:url value="/student/list.do" />">返回</a>
		</div>
	</form:form>
	<script type="text/javascript" src="<c:url value="/js/jquery.validate.min.js" />"></script>
	<script type="text/javascript" src="<c:url value="/js/student/add.js" />"></script>
</v:layout>

